﻿var apiurl = "http://localhost:62799/";
var oss = "http://localhost:51252/";
var HeadImg =oss + "Content/Image/HeadImg/";
var TemplateImg = oss+ "Content/Image/TemplateImg/";
var BasicInformationImg =oss+ "Content/Image/BasicInformationImg/";
var CommentImg = oss+ "Content/Image/CommentImg/";
var StrategImg = oss+ "Content/Image/StrategImg/";
var UserHeadImg = oss + "Content/Image/UserHeadImg/";

//获取url中的参数
function getUrlParam(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
    var r = window.location.search.substr(1).match(reg);  //匹配目标参数
    if (r != null) return unescape(r[2]); return null; //返回参数值
}

//点击图片弹出
function openimg(url) {
    layer.photos({
        photos: { "data": [{ "src": url }] }//图片地址
        , anim: 0 //0-6的选择，指定弹出图片动画类型，默认随机
    });
}
//点击打开指定页面
function openurl(url) {
    layer.open({
        type: 2,
        title: '很多时候，我们想最大化看，比如像这个页面。',
        shadeClose: true,
        shade: false,
        maxmin: true, //开启最大化最小化按钮
        area: ['893px', '600px'],
        content: url
    });
}

//过滤时间字符串：返回日期部分
function strDate(date) {
    var a = String(date);
    if (a.indexOf("T") != -1) {
        return a.split("T")[0];
    }
    else {
        return date;
    }
}